package com.qingcloud.base.api.remote.executor.factory;
import com.qingcloud.base.api.remote.executor.ExecutorApi;
import com.qingcloud.base.api.remote.executor.fallback.ExecutorApiFallback;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ExecutorApiFallbackFactory implements FallbackFactory<ExecutorApi> {
    @Override
    public ExecutorApi create(Throwable throwable) {
        ExecutorApiFallback fallback = new ExecutorApiFallback();
        fallback.setCause(throwable);
        return fallback;
    }
}
